package com.wl.mr.partition;

import org.apache.hadoop.mapreduce.Partitioner;

import javax.xml.soap.Text;

public class CustomPartitioner extends Partitioner<Text,PartitionBean> {
    @Override
    public int getPartition(Text text, PartitionBean partitionBean, int numPartitions) {
        int partition = 0;

        if(text.toString().equals("kar")){
            partition = 0;
        }else if(text.toString().equals("pandora")){
            partition = 1;
        }else{
            partition = 2;
        }

        return partition;
    }
}
